﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.FarmCommand;
using RBAC.MaHaiBo.Entity.Traceability;
using RBAC.MaHaiBo.Service.TraceabilityService;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.FarmHandler
{
    public class ListHygieneCommandHandler : IRequestHandler<ListHygieneCommand, List<Hygiene>>
    {
        /// <summary>
        /// 养殖服务层
        /// </summary>
        IFarmService FarmS;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="FarmS">养殖服务层</param>
        public ListHygieneCommandHandler(IFarmService FarmS)
        {
            this.FarmS = FarmS;
        }

        public async Task<List<Hygiene>> Handle(ListHygieneCommand request, CancellationToken cancellationToken)
        {
            return await FarmS.ListHygiene(request.LOT);
        }
    }
}
